<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j"
	template="/WEB-INF/templates/template.xhtml">

	<ui:define name="title">
		<c:choose>
			<c:when test="#{provinciaController.editing}">#{messages.provinciaEditTitulo}</c:when>
			<c:otherwise>#{messages.provinciaAltaTitulo}</c:otherwise>
		</c:choose>	
	</ui:define>
	<ui:define name="content">
		<h:form method="post">
			<h:panelGrid columns="3">
				<label for="name">#{messages.provinciaNombre}:</label>
				<h:inputText id="name" 
					value="#{provinciaController.entity.name}">
				</h:inputText>
				<rich:message for="name" ajaxRendered="true"/>
				
				<label for="codigoISO">#{messages.provinciaISO}:</label>
				<rich:select id="codigoISO" 
					enableManualInput="true" 
					defaultLabel="#{messages.ingresarValor}"
					value="#{provinciaController.entity.codigoISO}">
					<f:selectItems value="#{enumRefereceBean.codigosISO3166_2AR}"	/>
					<rich:validator />
				</rich:select>
				<rich:message for="codigoISO" ajaxRendered="true"/>
				<rich:notifyMessages stayTime="2000" nonblocking="true" />			
			</h:panelGrid>
			<h:panelGrid columns="2">
				<h:commandButton action="#{provinciaController.persist}" value="#{messages.submit}" />
				<h:commandButton action="#{provinciaController.cancel}" 
					value="#{messages.cancel}" 
					immediate="true"/>
			</h:panelGrid>
		</h:form>
	</ui:define>	
</ui:composition>
